package com.isoftstone.merchant.dao.payment;

import com.isoftstone.common.Page;
import com.isoftstone.merchant.entity.payment.Payment;
import com.isoftstone.util.PageData;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PaymentMapper {

    int deleteByPrimaryKey(Long payId);

    int insert(Payment record);

    int insertSelective(Payment record);

    Payment selectByPrimaryKey(Long payId);

    void insertPaymentToBatch(Payment payment);

    int updateByPrimaryKeySelective(Payment record);

    /**
     * 根据payId更新
     */
    int updateByPrimaryKey(Payment record);

    Payment selectPaymentById(@Param("payId")Long payId,@Param("projectId")Long projectId);

    List<Payment> selectPaymentListByExport(Payment payments);

    void updatePaymentUrgeCut(Payment payment);

    /**
     * 根据中银易商账户查询该登录用户的待缴费
     */
    List<Payment> delayPaymentlist(@Param("openAccount") String openAccount, @Param("feeId") String feeId)throws Exception;

    /**
     * 根据csp对账文件的返回数据查询
     */
    Payment queryPaymentByPayIdAndFactAmt(@Param("payId") Long payId, @Param("factAmt") String factAmt)throws Exception;

    List<Payment> getmFeeUserlistPage(Page page)throws Exception;

    void updatePayment(@Param("payId") Long payId)throws Exception;

    void updatePaymentForIsSelect(@Param("payId") Long payId) throws Exception;
    /**
     * 根据中银易商账户查询该登录用户的已缴费
     * @param openAccount
     * @return
     * @throws Exception
     */
    List<Payment> queryAlreadyPaymentOpenAccount(@Param("openAccount")String openAccount, @Param("feeId") String feeId, @Param("beginDate") String beginDate, @Param("endDate") String endDate)throws Exception;

    List<Payment> queryProjectDetail(@Param("corpId") String corpId, @Param("projectId") String projectId, @Param("feeId") String feeId)throws Exception;

    List<Payment> queryProjectDetailByStatus(@Param("corpId") String corpId, @Param("projectId") String projectId, @Param("feeId") String feeId, @Param("status") String status)throws Exception;

    List<Payment> queryMemberShipDetail(@Param("corpId") String corpId, @Param("projectId") String projectId, @Param("feeId") String feeId)throws Exception;

    List<Payment> queryMemberShipDetailByStatus(@Param("corpId") String corpId, @Param("projectId") String projectId, @Param("feeId") String feeId, @Param("status") String status)throws Exception;

    Payment queryPaymentByPayIdAndFeeUserId(@Param("payId") Long payId, @Param("feeUserId") String feeUserId)throws Exception;

    //线下收费用
    List<Payment> selectPaymentlistPage(Page page);

    void addPayment(Payment payment)throws Exception;

    Payment getPayUserNumber(Page page)throws Exception;

    /**
     * 统计交易数
     * @param params
     * @return
     */
    String countPayment(PageData params);

    String sumPayment(PageData params);

    Integer getAllPayNumber(Page page)throws Exception;

    Integer getTodayPayNumber(Page page)throws Exception;

    String countBindUser(PageData params);

    Double getAllPayMoney(Page page)throws Exception;

    Double getTodayPayMoney(Page page)throws Exception;

    Double getTodayPayMoneys(PageData pd)throws Exception;

    Double getAllMoney(PageData pd)throws Exception;

    Integer getTodayPayNumbers(PageData pd)throws Exception;

    Integer getAllPayNumbers(PageData pd)throws Exception;
}